function insertAction(html) {
	var anySelection = false;
	var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
	var focusElm = inst.getFocusElement();
	var selectedText = inst.selection.getSelectedText();

	tinyMCEPopup.execCommand("mceBeginUndoLevel");
	
	if (tinyMCE.selectedElement)
		anySelection = (tinyMCE.selectedElement.nodeName.toLowerCase() == "img") || (selectedText && selectedText.length > 0);
	if (anySelection || (focusElm != null && focusElm.nodeName == "A")) {
		tinyMCEPopup.execCommand("mceInsertContent", false, html + inst.selection.getSelectedHTML() + '</a>');
	} else {
		//alert('Nera');
	}
	
	tinyMCE._setEventsEnabled(inst.getBody(), false);
	tinyMCEPopup.execCommand("mceEndUndoLevel");
}